# 第一题
def func6(x, y):
    sum = int(x)*10**len(y)+ int(y)
    return sum

lst = ['a', '1', '3ff', '234', '', '8','12']
print(reduce(func6, list(filter(lambda x:x.isdigit(),lst))))

# 第二题
list1 = [7,-8,5,4,0,-2,-5]
print(sorted(list1,reverse=True))  # 正数在前，负数在后
print(sorted(list1))  # 整数从小到大
# 负数部分从小到大
print(sorted(list(filter(lambda x:x>=0,list1)),reverse=True)+sorted(list(filter(lambda x:x<0,list1))))


s = 'asdfd123HUGFY786'

print(''.join(sorted(s,key=lambda x: (x.isdigit(),x.isdigit() and int(x)%2 ==0,x.isupper(),x))))





